<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qclevent.cpp -->
  <title>QCLEventList Class Reference</title>
  <link rel="stylesheet" type="text/css" href="style/style.css" />
  <script src="scripts/jquery.js" type="text/javascript"></script>
  <script src="scripts/functions.js" type="text/javascript"></script>
  <script src="./scripts/superfish.js" type="text/javascript"></script>
  <link rel="stylesheet" type="text/css" href="style/superfish.css" />  <script src="./scripts/narrow.js" type="text/javascript"></script>
  <link rel="stylesheet" type="text/css" href="style/narrow.css" />
  <!--[if IE]>
<meta name="MSSmartTagsPreventParsing" content="true">
<meta http-equiv="imagetoolbar" content="no">
<![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie6.css">
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie7.css">
<![endif]-->
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="style/style_ie8.css">
<![endif]-->
</head>
<body class="" onload="CheckEmptyAndLoadList();">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="150"><img src="images/qt-logo.png" align="left" border="0" />&nbsp;&nbsp;<img src="images/qtopencl-logo.png" border="0" /></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"> <a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="qtopencl-all-classes.html"><font color="#004faf">All Classes</font></a></td>
</table>              <li><a href="modules.html">Modules</a></li>              <li>QtCL</li>
              <li>QCLEventList</li>
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">QCLEventList Class Reference</h1>
<!-- $$$QCLEventList-brief -->
<p>The QCLEventList class represents a list of <a href="qclevent.html">QCLEvent</a> objects. <a href="#details">More...</a></p>
<!-- @@@QCLEventList -->
<pre class="highlightedCode brush: cpp">    #include &lt;QCLEventList&gt;</pre><p>This class was introduced in QtOpenCL 4.7.</p>
<ul>
<li><a href="qcleventlist-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qcleventlist.html#QCLEventList">QCLEventList</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qcleventlist.html#QCLEventList-2">QCLEventList</a></b> ( const QCLEvent &amp; <i>event</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qcleventlist.html#QCLEventList-3">QCLEventList</a></b> ( const QCLEventList &amp; <i>other</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qcleventlist.html#dtor.QCLEventList">~QCLEventList</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcleventlist.html#append">append</a></b> ( const QCLEvent &amp; <i>event</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcleventlist.html#append-2">append</a></b> ( const QCLEventList &amp; <i>other</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLEvent </td><td class="memItemRight bottomAlign"><b><a href="qcleventlist.html#at">at</a></b> ( int <i>index</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qcleventlist.html#contains">contains</a></b> ( const QCLEvent &amp; <i>event</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const cl_event * </td><td class="memItemRight bottomAlign"><b><a href="qcleventlist.html#eventData">eventData</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qcleventlist.html#isEmpty">isEmpty</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcleventlist.html#remove">remove</a></b> ( const QCLEvent &amp; <i>event</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qcleventlist.html#size">size</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QFuture&lt;void&gt; </td><td class="memItemRight bottomAlign"><b><a href="qcleventlist.html#toFuture">toFuture</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qcleventlist.html#waitForFinished">waitForFinished</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qcleventlist.html#operator-QFuture-ltvoid-gt">operator QFuture&lt;void&gt;</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLEventList &amp; </td><td class="memItemRight bottomAlign"><b><a href="qcleventlist.html#operator-2b-eq">operator+=</a></b> ( const QCLEvent &amp; <i>event</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLEventList &amp; </td><td class="memItemRight bottomAlign"><b><a href="qcleventlist.html#operator-2b-eq-2">operator+=</a></b> ( const QCLEventList &amp; <i>other</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLEventList &amp; </td><td class="memItemRight bottomAlign"><b><a href="qcleventlist.html#operator-lt-lt">operator&lt;&lt;</a></b> ( const QCLEvent &amp; <i>event</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLEventList &amp; </td><td class="memItemRight bottomAlign"><b><a href="qcleventlist.html#operator-lt-lt-2">operator&lt;&lt;</a></b> ( const QCLEventList &amp; <i>other</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCLEventList &amp; </td><td class="memItemRight bottomAlign"><b><a href="qcleventlist.html#operator-eq">operator=</a></b> ( const QCLEventList &amp; <i>other</i> )</td></tr>
</table>
<a name="details"></a>
<!-- $$$QCLEventList-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QCLEventList class represents a list of <a href="qclevent.html">QCLEvent</a> objects.</p>
</div>
<p>See also <a href="qclevent.html">QCLEvent</a>.</p>
<!-- @@@QCLEventList -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QCLEventList[overload1]$$$QCLEventList -->
<h3 class="fn"><a name="QCLEventList"></a>QCLEventList::QCLEventList ()</h3>
<p>Constructs an empty list of OpenCL events.</p>
<!-- @@@QCLEventList -->
<!-- $$$QCLEventList$$$QCLEventListconstQCLEvent& -->
<h3 class="fn"><a name="QCLEventList-2"></a>QCLEventList::QCLEventList ( const <a href="qclevent.html">QCLEvent</a> &amp; <i>event</i> )</h3>
<p>Constructs a list of OpenCL events that contains <i>event</i>. If <i>event</i> is null, this constructor will construct an empty list.</p>
<p>See also <a href="qcleventlist.html#append">append</a>().</p>
<!-- @@@QCLEventList -->
<!-- $$$QCLEventList$$$QCLEventListconstQCLEventList& -->
<h3 class="fn"><a name="QCLEventList-3"></a>QCLEventList::QCLEventList ( const QCLEventList &amp; <i>other</i> )</h3>
<p>Constructs a copy of <i>other</i>.</p>
<p>See also <a href="qcleventlist.html#operator-eq">operator=</a>().</p>
<!-- @@@QCLEventList -->
<!-- $$$~QCLEventList[overload1]$$$~QCLEventList -->
<h3 class="fn"><a name="dtor.QCLEventList"></a>QCLEventList::~QCLEventList ()</h3>
<p>Destroys this list of OpenCL events.</p>
<!-- @@@~QCLEventList -->
<!-- $$$append[overload1]$$$appendconstQCLEvent& -->
<h3 class="fn"><a name="append"></a>void QCLEventList::append ( const <a href="qclevent.html">QCLEvent</a> &amp; <i>event</i> )</h3>
<p>Appends <i>event</i> to this list of OpenCL events if it is not null. Does nothing if <i>event</i> is null.</p>
<p>See also <a href="qcleventlist.html#remove">remove</a>().</p>
<!-- @@@append -->
<!-- $$$append$$$appendconstQCLEventList& -->
<h3 class="fn"><a name="append-2"></a>void QCLEventList::append ( const QCLEventList &amp; <i>other</i> )</h3>
<p>This is an overloaded function.</p>
<p>Appends the contents of <i>other</i> to this event list.</p>
<!-- @@@append -->
<!-- $$$at[overload1]$$$atint -->
<h3 class="fn"><a name="at"></a><a href="qclevent.html">QCLEvent</a> QCLEventList::at ( int <i>index</i> ) const</h3>
<p>Returns the event at <i>index</i> in this event list, or a null <a href="qclevent.html">QCLEvent</a> if <i>index</i> is out of range.</p>
<p>See also <a href="qcleventlist.html#size">size</a>() and <a href="qcleventlist.html#contains">contains</a>().</p>
<!-- @@@at -->
<!-- $$$contains[overload1]$$$containsconstQCLEvent& -->
<h3 class="fn"><a name="contains"></a>bool QCLEventList::contains ( const <a href="qclevent.html">QCLEvent</a> &amp; <i>event</i> ) const</h3>
<p>Returns true if this event list contains <i>event</i>; false otherwise.</p>
<p>See also <a href="qcleventlist.html#at">at</a>() and <a href="qcleventlist.html#remove">remove</a>().</p>
<!-- @@@contains -->
<!-- $$$eventData[overload1]$$$eventData -->
<h3 class="fn"><a name="eventData"></a>const cl_event * QCLEventList::eventData () const</h3>
<p>Returns a const pointer to the raw OpenCL event data in this event list; null if the list is empty.</p>
<p>This function is intended for use with native OpenCL library functions that take an array of <tt>cl_event</tt> objects as an argument.</p>
<p>See also <a href="qcleventlist.html#size">size</a>().</p>
<!-- @@@eventData -->
<!-- $$$isEmpty[overload1]$$$isEmpty -->
<h3 class="fn"><a name="isEmpty"></a>bool QCLEventList::isEmpty () const</h3>
<p>Returns true if this is an empty list; false otherwise.</p>
<p>See also <a href="qcleventlist.html#size">size</a>().</p>
<!-- @@@isEmpty -->
<!-- $$$remove[overload1]$$$removeconstQCLEvent& -->
<h3 class="fn"><a name="remove"></a>void QCLEventList::remove ( const <a href="qclevent.html">QCLEvent</a> &amp; <i>event</i> )</h3>
<p>Removes <i>event</i> from this event list.</p>
<p>See also <a href="qcleventlist.html#append">append</a>() and <a href="qcleventlist.html#contains">contains</a>().</p>
<!-- @@@remove -->
<!-- $$$size[overload1]$$$size -->
<h3 class="fn"><a name="size"></a>int QCLEventList::size () const</h3>
<p>Returns the size of this event list.</p>
<p>See also <a href="qcleventlist.html#isEmpty">isEmpty</a>() and <a href="qcleventlist.html#at">at</a>().</p>
<!-- @@@size -->
<!-- $$$toFuture[overload1]$$$toFuture -->
<h3 class="fn"><a name="toFuture"></a>QFuture&lt;void&gt; QCLEventList::toFuture () const</h3>
<p>Returns a QFuture object that can be used to track when all of the events on this list finish.</p>
<p>This function creates a thread on the host CPU to monitor the events in the background. If the caller wants to block in the foreground thread, then <a href="qcleventlist.html#waitForFinished">waitForFinished</a>() is recommended instead of using toFuture(), because <a href="qcleventlist.html#waitForFinished">waitForFinished</a>() does not need to create an extra thread on the host CPU.</p>
<p>If however the caller wants to receive notification of the events finishing via a signal, then toFuture() can be used with QFutureWatcher to receive the signal:</p>
<pre class="highlightedCode brush: cpp">    QCLEventList list;
    list += event1;
    list += event2;
    QFutureWatcher&lt;void&gt; *watcher = new QFutureWatcher&lt;void&gt;(this);
    watcher-&gt;setFuture(list.toFuture());
    connect(watcher, SIGNAL(finished()), this, SLOT(eventsFinished()));</pre>
<p><a href="qcleventlist.html">QCLEventList</a> has an implicit conversion operator to QFuture&lt;void&gt;, which allows the QFutureWatcher::setFuture() call to be shortened as follows:</p>
<pre class="highlightedCode brush: cpp">    watcher-&gt;setFuture(list);</pre>
<!-- @@@toFuture -->
<!-- $$$waitForFinished[overload1]$$$waitForFinished -->
<h3 class="fn"><a name="waitForFinished"></a>void QCLEventList::waitForFinished ()</h3>
<p>Waits for all of the events in this list to be signalled as finished. The calling thread is blocked until all of the events are signalled. If the list is empty, then this function returns immediately.</p>
<p>See also <a href="qclevent.html#waitForFinished">QCLEvent::waitForFinished</a>().</p>
<!-- @@@waitForFinished -->
<!-- $$$operator QFuture<void>[overload1]$$$operator QFuture<void> -->
<h3 class="fn"><a name="operator-QFuture-ltvoid-gt"></a>QCLEventList::operator QFuture&lt;void&gt; () const</h3>
<p>Equivalent to calling <a href="qcleventlist.html#toFuture">toFuture</a>().</p>
<p>This conversion operator is intended to help with interfacing OpenCL to code that uses QtConcurrent.</p>
<!-- @@@operator QFuture<void> -->
<!-- $$$operator+=[overload1]$$$operator+=constQCLEvent& -->
<h3 class="fn"><a name="operator-2b-eq"></a>QCLEventList &amp; QCLEventList::operator+= ( const <a href="qclevent.html">QCLEvent</a> &amp; <i>event</i> )</h3>
<p>Same as append(<i>event</i>).</p>
<!-- @@@operator+= -->
<!-- $$$operator+=$$$operator+=constQCLEventList& -->
<h3 class="fn"><a name="operator-2b-eq-2"></a>QCLEventList &amp; QCLEventList::operator+= ( const QCLEventList &amp; <i>other</i> )</h3>
<p>Same as append(<i>other</i>).</p>
<!-- @@@operator+= -->
<!-- $$$operator<<[overload1]$$$operator<<constQCLEvent& -->
<h3 class="fn"><a name="operator-lt-lt"></a>QCLEventList &amp; QCLEventList::operator&lt;&lt; ( const <a href="qclevent.html">QCLEvent</a> &amp; <i>event</i> )</h3>
<p>Same as append(<i>event</i>).</p>
<!-- @@@operator<< -->
<!-- $$$operator<<$$$operator<<constQCLEventList& -->
<h3 class="fn"><a name="operator-lt-lt-2"></a>QCLEventList &amp; QCLEventList::operator&lt;&lt; ( const QCLEventList &amp; <i>other</i> )</h3>
<p>Same as append(<i>other</i>).</p>
<!-- @@@operator<< -->
<!-- $$$operator=[overload1]$$$operator=constQCLEventList& -->
<h3 class="fn"><a name="operator-eq"></a>QCLEventList &amp; QCLEventList::operator= ( const QCLEventList &amp; <i>other</i> )</h3>
<p>Assigns the contents of <i>other</i> to this object.</p>
<!-- @@@operator= -->
</div>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td align="left">Copyright &copy; 2010 Nokia Corporation</td>
<td align="right">QtOpenCL Documentation</td>
</tr></table></div></address>  <script src="scripts/functions.js" type="text/javascript"></script>
  <script type="text/javascript">
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-4457116-5']);
  _gaq.push(['_trackPageview']);
  (function() {
  var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
  ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
  var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
  </script>
</body>
</html>
